home *** CD-ROM | disk | FTP | other *** search
Wrap
/* $Id: I3DSHObj.H 1.14 1997/06/03 00:13:32 john Exp $ */ /*****************************************************************************\ * * * I3DShObj.h * * I3DShObject * * I3DShPrimitive * * I3DShPolygonList * * I3DShPolygonArray * * I3DShPatchList * * I3DShPatchArray * * I3DShFlatSurface * * * * Copyright (c) 1995, Ray Dream, Inc. All rights reserved. * * * \*****************************************************************************/ #ifndef __I3DSHOBJ__ #define __I3DSHOBJ__ #ifndef __3DCOTYPE__ #include "3DCoType.h" #endif //****** Globally Unique Ids ************************************************** DEFINE_GUID(IID_I3DShObject, 0xBDEA68A0L, 0x3A02, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02); DEFINE_GUID(IID_I3DShPrimitive, 0x5C9601A7L, 0x7CC3, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02); DEFINE_GUID(IID_I3DShPolygonList, 0xBFBEDA80L, 0x3A02, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02); DEFINE_GUID(IID_I3DShPolygonArray, 0xC1840A20L, 0x3A02, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02); DEFINE_GUID(IID_I3DShPatchList, 0xBFBEDA81L, 0x3A02, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02); DEFINE_GUID(IID_I3DShPatchArray, 0xC361A3C0L, 0x3A02, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02); DEFINE_GUID(IID_I3DShFlatSurface, 0xC546DE80L, 0x3A02, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02); DEFINE_GUID(IID_I3DShFacetMesh, 0x11819661, 0xd86c, 0x11d0, 0x85, 0x5a, 0x0, 0xa0, 0xc9, 0xc, 0x1b, 0xf1); //-- The following classes are available in Ray Dream Designer: DEFINE_GUID(CLSID_StandardPolygonList, 0xC756D2C0L, 0x3A02, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02); DEFINE_GUID(CLSID_StandardPolygonArray, 0xCA395940L, 0x3A02, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02); DEFINE_GUID(CLSID_StandardPatchList, 0x45271a20, 0xba0f, 0x11cf, 0x99, 0x09, 0x00, 0x40, 0x05, 0x22, 0xbf, 0xcc); DEFINE_GUID(CLSID_StandardPatchArray, 0xCBF56120L, 0x3A02, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02); DEFINE_GUID(CLSID_StandardFlatSurface, 0xCDC9D300L, 0x3A02, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02); DEFINE_GUID(CLSID_StandardFacetMesh, 0x9604bf60, 0xd86b, 0x11d0, 0x85, 0x5a, 0x0, 0xa0, 0xc9, 0xc, 0x1b, 0xf1); struct ShadingShape; struct I3DShShader; struct I3DShScene; struct IFacetMesh; /*****************************************************************************\ * I3DShObject * * * * I3DShObject contain the geometry and shading information of the objects * * in a scene. * * They are kept in a list in the scene (the Objects List), and can be * * instanciated as many times as needed in a scene. * * * * * There are two types of Objects: Primitives and Scenes (a Scene can be * * instanciated in another Scene). See I3DShPrimitive and I3DShScene. * * * \*****************************************************************************/ #undef INTERFACE #define INTERFACE I3DShObject DECLARE_INTERFACE_(I3DShObject, IUnknown) { // IUnknown methods STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; STDMETHOD_(ULONG, AddRef) (THIS) PURE; STDMETHOD_(ULONG, Release) (THIS) PURE; // I3DShObject methods //-- Naming STDMETHOD(SetName) (THIS_ char* name) PURE; STDMETHOD(GetName) (THIS_ char* name) PURE; //-- Shading calls STDMETHOD(SetSimpleShading) (THIS_ COLOR3D* color, NUM3D specularIntensity, NUM3D specularIndex, NUM3D reflection, NUM3D transparency) PURE; STDMETHOD(SetPrimerShader) (THIS_ I3DShShader* primerShader) PURE; STDMETHOD_(ULONG, GetUVSpaceCount) (THIS) PURE; STDMETHOD(GetUVSpace) (THIS_ ULONG uvSpaceID, UVSpaceInfo* uvSpaceInfo) PURE; STDMETHOD(AddShadingShape) (THIS_ ShadingShape* shadingShape, ULONG uvSpaceID) PURE; STDMETHOD_(I3DShScene*, GetScene) (THIS) PURE; //-- New calls API Level 9 STDMETHOD_(BOOLEAN, IsInfinite) (THIS) PURE; }; /*****************************************************************************\ * I3DShPrimitive * * * * A Primitive is a simple geometric Object: sphere, polygon list, etc. * * Other interfaces supported: I3DShObject * * * \*****************************************************************************/ #undef INTERFACE #define INTERFACE I3DShPrimitive DECLARE_INTERFACE_(I3DShPrimitive, IUnknown) { // IUnknown methods STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; STDMETHOD_(ULONG, AddRef) (THIS) PURE; STDMETHOD_(ULONG, Release) (THIS) PURE; // I3DShPrimitive methods //-- Geometry calls STDMETHOD_(BOOLEAN, IsPatchBased) (THIS) PURE; STDMETHOD(EnumPatches) (THIS_ EnumPatchesCallback callback, void* privData) PURE; STDMETHOD(EnumFacets) (THIS_ EnumFacetsCallback callback, void* privData) PURE; //-- New geometry calls (API Level 6) STDMETHOD(EnumFacetsWithConversion) (THIS_ EnumFacetsCallback callback, void* privData, BOOLEAN doPatches, NUM3D error) PURE; // Use this call when you want facets even for patch based objects, and be able to control the error in the facettisation process //-- New calls API Level 9 STDMETHOD(ChangedData) (THIS) PURE; // Call this if you changed some data of the Primitive, so the Shell hear about it STDMETHOD(GetFMesh) (THIS_ NUM3D lod, IFacetMesh*& amesh) PURE; STDMETHOD_(BOOLEAN, IsVolumic) (THIS) PURE; // "Volumic" primitives are special primitives such as particle systems, fog, fountain, etc. }; //****************************** I3DShFacetMesh *********************** DECLARE_INTERFACE_(I3DShFacetMesh, IUnknown) { STDMETHOD(SetBBox) (const BOX3D &bbox) PURE; STDMETHOD(SetNbrLOD) (short nbrLod) PURE; STDMETHOD(SetFacetMesh) (short index,NUM3D lod,const FacetMesh &amesh) PURE; STDMETHOD(SetUVSpaceCount) (long nbrUV) PURE; STDMETHOD(SetUVSpace) (long index,const UVSpaceInfo &uvSpaceInfo) PURE; }; /*****************************************************************************\ * I3DShPolygonList * * * * I3DShPolygonList is simply a bag of triangular facets. * * Other interfaces supported: I3DShObject, I3DShPrimitive * * * \*****************************************************************************/ #undef INTERFACE #define INTERFACE I3DShPolygonList DECLARE_INTERFACE_(I3DShPolygonList, IUnknown) { // IUnknown methods STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; STDMETHOD_(ULONG, AddRef) (THIS) PURE; STDMETHOD_(ULONG, Release) (THIS) PURE; // I3DShPolygonList methods //-- Init calls STDMETHOD(Init) (THIS_ BOOLEAN hasNormals, BOOLEAN hasUV) PURE; STDMETHOD(SetUVSpace0) (THIS_ VECTOR2D* minUV, VECTOR2D* maxUV) PURE; // Set UV Space #0. Use SetUVSpace if you have multiple UV Spaces //-- Facets handling STDMETHOD(PreAllocateFacets) (THIS_ ULONG nbFacets) PURE; // Use this if you know in advance how many facets you will build STDMETHOD(AddFacet) (THIS_ FACET3D* facet) PURE; STDMETHOD_(ULONG, CountFacets) (THIS) PURE; STDMETHOD(CalcNormals) (THIS_ NUM3D smoothAngle) PURE; // Use this call if you do not know how to make the normals STDMETHOD_(FACET3D*, GetIndFacets) (THIS_ ULONG index) PURE; // (index is 1 based) STDMETHOD(RemoveFacet) (THIS_ ULONG index) PURE; // (index is 1 based) //--Init call STDMETHOD(SetHasUVSpace) (THIS_ BOOLEAN hasUV) PURE; // If false, will remove all previous UV Space definitions //-- New UV Space calls (API level 6) STDMETHOD(SetUVSpace) (THIS_ UVSpaceInfo* uvSpaceInfo) PURE; // Set an UV Space. The UV space will be added if it was not defined yet STDMETHOD(GetUVSpace) (THIS_ ULONG uvSpaceID, UVSpaceInfo* uvSpaceInfo) PURE; // Get UV Space info }; /*****************************************************************************\ * I3DShPolygonArray * * * * I3DShPolygonArray is a regular array of 3D points and normals. * * Other interfaces supported: I3DShObject, I3DShPrimitive * * * \*****************************************************************************/ #undef INTERFACE #define INTERFACE I3DShPolygonArray DECLARE_INTERFACE_(I3DShPolygonArray, IUnknown) { // IUnknown methods STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; STDMETHOD_(ULONG, AddRef) (THIS) PURE; STDMETHOD_(ULONG, Release) (THIS) PURE; // I3DShPolygonArray methods //-- Init calls STDMETHOD(Init) (THIS_ ULONG uCount, ULONG vCount, BOOLEAN uClosed, BOOLEAN vClosed) PURE; //-- Geometry calls STDMETHOD(SetVertex) (THIS_ ULONG uIndex, ULONG vIndex, VECTOR3D* vertex, VECTOR3D* normal) PURE; // normal can be NULL STDMETHOD(GetVertex) (THIS_ ULONG uIndex, ULONG vIndex, VECTOR3D* vertex, VECTOR3D* normal) PURE; // normal can be NULL //-- (u,v) calls STDMETHOD(MeshSetU) (THIS_ ULONG uIndex, NUM3D uValue) PURE; STDMETHOD(MeshSetV) (THIS_ ULONG vIndex, NUM3D vValue) PURE; STDMETHOD(MeshGetU) (THIS_ ULONG uIndex, NUM3D* uValue) PURE; STDMETHOD(MeshGetV) (THIS_ ULONG vIndex, NUM3D* vValue) PURE; //-- Goodies STDMETHOD(CalcUV) (THIS) PURE; // Calculate for you all (u,v) values if you do not know how to make them STDMETHOD(CalcNormals) (THIS_ BOOLEAN smooth) PURE; // Calculate for you all normals if you do not know how to make them }; /*****************************************************************************\ * I3DShPatchList * * * * I3DShPatchList is simply a bag of cubic 4 x 4 Bezier patches. * * Other interfaces supported: I3DShObject, I3DShPrimitive * * * \*****************************************************************************/ #undef INTERFACE #define INTERFACE I3DShPatchList DECLARE_INTERFACE_(I3DShPatchList, IUnknown) { // IUnknown methods STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; STDMETHOD_(ULONG, AddRef) (THIS) PURE; STDMETHOD_(ULONG, Release) (THIS) PURE; // I3DShPatchList methods //-- Init calls STDMETHOD(Init) (THIS_ BOOLEAN hasUV) PURE; STDMETHOD(SetUVSpace0) (THIS_ VECTOR2D* minUV, VECTOR2D* maxUV) PURE; // Set UV Space #0. Use SetUVSpace if you have multiple UV Spaces STDMETHOD(SetHasUVSpace) (THIS_ BOOLEAN hasUV) PURE; // If false, will remove all previous UV Space definitions //-- Patches handling STDMETHOD(AddPatch) (THIS_ PATCH3D* patch) PURE; STDMETHOD_(ULONG, CountPatches) (THIS) PURE; //-- New UV Space calls (API level 6) STDMETHOD(SetUVSpace) (THIS_ UVSpaceInfo* uvSpaceInfo) PURE; // Set an UV Space. The UV space will be added if it was not defined yet STDMETHOD(GetUVSpace) (THIS_ ULONG uvSpaceID, UVSpaceInfo* uvSpaceInfo) PURE; // Get UV Space info }; /*****************************************************************************\ * I3DShPatchArray * * * * I3DShPatchArray is an array of cubic 4 x 4 Bezier patches. * * Other interfaces supported: I3DShObject, I3DShPrimitive * * * \*****************************************************************************/ #undef INTERFACE #define INTERFACE I3DShPatchArray DECLARE_INTERFACE_(I3DShPatchArray, IUnknown) { // IUnknown methods STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; STDMETHOD_(ULONG, AddRef) (THIS) PURE; STDMETHOD_(ULONG, Release) (THIS) PURE; // I3DShPatchArray methods //-- Init calls STDMETHOD(Init) (THIS_ ULONG uCount, ULONG vCount) PURE; //-- Geometry calls STDMETHOD(SetPatch) (THIS_ ULONG uIndex, ULONG vIndex, PATCH3D* patch) PURE; STDMETHOD(GetPatch) (THIS_ ULONG uIndex, ULONG vIndex, PATCH3D* patch) PURE; //-- (u,v) calls STDMETHOD(MeshSetU) (THIS_ ULONG uIndex, NUM3D uValue) PURE; STDMETHOD(MeshSetV) (THIS_ ULONG vIndex, NUM3D vValue) PURE; STDMETHOD(MeshGetU) (THIS_ ULONG uIndex, NUM3D* uValue) PURE; STDMETHOD(MeshGetV) (THIS_ ULONG vIndex, NUM3D* vValue) PURE; //-- Goodies STDMETHOD(CalcUV) (THIS) PURE; // Calculate for you all (u,v) values if you do not know how to make them }; /*****************************************************************************\ * I3DShFlatSurface * * * * I3DShFlatSurface is a flat object made of curves and polygons * * Other interfaces supported: I3DShObject, I3DShPrimitive * * * * Pseudo "grammar" for building 2D curves: * FLATSURFACE = * BeginFlatSurface * GROUP * EndFlatSurface * * GROUP = * BeginGroup * GROUP | COMPOUND | PATH 1 or more times * EndGroup * * COMPOUND = * BeginCmpnd * GROUP | COMPOUND | PATH 1 or more times * EndCmpnd * * PATH = * BeginPath * LineTo | BezierTo 1 or more times * EndPath * * \*****************************************************************************/ #undef INTERFACE #define INTERFACE I3DShFlatSurface DECLARE_INTERFACE_(I3DShFlatSurface, IUnknown) { // IUnknown methods STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; STDMETHOD_(ULONG, AddRef) (THIS) PURE; STDMETHOD_(ULONG, Release) (THIS) PURE; // I3DShFlatSurface methods //-- Geometry building calls (see grammar above) STDMETHOD(BeginFlatSurface) (THIS) PURE; // Call this before building the surface STDMETHOD(EndFlatSurface) (THIS) PURE; // And this when you are done STDMETHOD(BeginGroup) (THIS) PURE; STDMETHOD(EndGroup) (THIS) PURE; STDMETHOD(BeginCmpnd) (THIS) PURE; // Use compounds to make holes STDMETHOD(EndCmpnd) (THIS) PURE; STDMETHOD(BeginPath) (THIS_ VECTOR2D* firstPoint) PURE; STDMETHOD(LineTo) (THIS_ VECTOR2D* secondPoint) PURE; STDMETHOD(BezierTo) (THIS_ VECTOR2D* secondPoint, VECTOR2D* thirdPoint, VECTOR2D* fourthPoint) PURE; STDMETHOD(EndPath) (THIS) PURE; }; #endif